import React, {JSX} from "react";
import {View} from "@tarojs/components";
import './index.scss';

const HeadTitle : React.FC<IHeadTitle> = ({title, subTitle, border, bgColor}):JSX.Element => {
  return (
    <View className='HeadTitle align-center' style={{
      borderBottomColor: border ? '#EBEBEB' : 'transparent',
      backgroundColor: bgColor || '#fff' }}
    >
      <View className='box'></View>
      <View className='align-baseline'>
        <View className='title'>{title}</View>
        <View className='subTitle'>{subTitle}</View>
      </View>
    </View>
  )
}

export interface IHeadTitle{
  title: string,
  subTitle?: string,
  border?: boolean,
  bgColor?: string,
}

export default HeadTitle;
